#!/bin/bash

#Manage Xorg.Conf
#
#Authors:
#  Bruno Goncalves Araujo <www.biglinux.com.br>
#
#License: GPLv2 or later
#################################################

CMDLINE="$(cat /proc/cmdline)"

stringinstring(){
case "$2" in *$1*) return 0;; esac
return 1
}

getbootparam(){
stringinstring " $1=" "$CMDLINE" || return 1
result="${CMDLINE##*$1=}"
result="${result%%[ 	]*}"
echo "$result"
return 0
}

bigxorgedit --config screen= $(getbootparam 'screen') xmodule=$(getbootparam 'xmodule') refresh=$(getbootparam 'refresh') edid=$(getbootparam 'edid') mouse=$(getbootparam 'mouse')